package day10.Stream;

import java.util.ArrayList;
import java.util.stream.Stream;

public class Lian05 {
    public static void main(String[] args) {
        ArrayList<String> manlist = new ArrayList<>();
        manlist.add("郑伊健");
        manlist.add("王宝强");
        manlist.add("徐峥");
        manlist.add("鹿晗");
        manlist.add("黄渤");
        manlist.add("阳顶天");
        ArrayList<String> womanlist = new ArrayList<>();
        womanlist.add("郑爽");
        womanlist.add("杨紫");
        womanlist.add("黄圣依");
        womanlist.add("杨幂");
        womanlist.add("张天爱");
        Stream<String> stream1 = manlist.stream()
                .filter(name -> name.length() == 3).limit(2);
        Stream<String> stream2 = womanlist.stream()
                .filter(name -> name.startsWith("杨")).skip(1);
        Stream.concat(stream1, stream2)
                .forEach(name -> {
                    Actor actor=new Actor(name);
                    System.out.println(actor);
                });


    }
}
